import { Injectable } from '@angular/core';
import { HttpClient } from '../../../../providers/httpClient';
import { Config } from '../../../../providers/config';
import { Storage } from '@ionic/storage';

@Injectable()
export class MarketingLinupListService {
	constructor(
		public httpClient: HttpClient,
		public config: Config,
    public storage: Storage
		) { }
	getListData(page, condition) {
		let postBody = {
			"module": "KSB",
			"method": "USP_A02_0190",
			"type": "USP",
      "format": "json",
			"params": {//入参顺序必须按文档顺序
				"usr_id": "",
				"taskname": condition.taskname,
				"taskstatus": condition.taskstatus,
				"pageLines": this.config.pageSize,
				"currentPage": page,
        "resourceid": condition.resourceid
			}
		};

    return this.httpClient.post(postBody, {
      isShowLoading: true
    });

	}

  getUsrIDFromOAServer(login_nm) {
    let postBody = {
      "module": "OAServer",
      "method": "getUSBUsrIDByLoginID",
      "params": {
        "login_nm":login_nm
      }
    };

    return this.httpClient.post(postBody, {
      isShowLoading: false
    });
  }
}
